home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kids' Bible Fun Pack
/
Kids' CD-ROM Bible Fun Pack (1997)(Education Publishing Concepts)[Mac-PC].iso
/
mac
/
BIBLEC
/
XTRAS
/
FileFlex Xtras
/
-Database Designer
/
00083_Script_83
< prev
next >
Wrap
Text File
|
1995-07-22
|
4KB
|
138 lines
-- These routines all open and close not only the database, but
-- the session as well. Normally, you'd want to do a DBOpenSession
-- at the very beginning, open all files and indexes, and close things
-- up only at the very end. But because this tool is to be used during
-- unpredictable development, I wanted to make sure FileFlex wasn't
-- already active.
on doRecordScroll
global browseDBRecord, browseDBFile, dgDkBlueColor
cursor 4
-- let's open it all up
put DBOpenSession() into DBResult
if DBResult < 0 then
cursor -1
BadOpenDatabaseAlert
exit
end if
put DBUse(browseDBFile) into dbID
if dbID < 0 then
cursor -1
BadOpenDatabaseAlert
exit
end if
put DBListFields() into theFields
put EMPTY into field "masterNameList"
put EMPTY into field "masterContentList"
delete line 1 of theFields
put BrowseDBRecord+1 into BrowseDBRecord
put DBGo(BrowseDBRecord) into DBResult
if DBResult < 0 then
cursor -1
BadOpenDatabaseAlert
exit
end if
put DBGetCurrRecVal("X") into theData
delete line 1 to 2 of theData
--
-- Parse fields from the DBListFields into our display format
--
repeat with i = 1 to the number of lines of theFields
if field "masterNameList" <> EMPTY then
put field "masterNameList" & RETURN into field "masterNameList"
put field "masterContentList" & RETURN into field "masterContentList"
end if
put item 1 of line i of theFields into theName
put field "masterNameList" & theName into field "masterNameList"
put line i of theData into theLine
put item 2 of theLine into theType
delete item 1 to 2 of theLine
if theType <> "M" then
put field "masterContentList" & string(theLine) into field "masterContentList"
else
put DBGetMemo(theName) into theMemo
put EMPTY into cleanMemo
repeat with j = 1 to the number of chars of theMemo
if char j of theMemo <> RETURN then
if charToNum(char j of theMemo) > 128 then
put cleanMemo & "." into cleanMemo
else
put cleanMemo & char j of theMemo into cleanMemo
end if
else
put cleanMemo & " " into cleanMemo
end if
end repeat
put char 1 to 75 of cleanMemo & "..." into cleanMemo
put field "masterContentList" & cleanMemo into field "masterContentList"
end if
end repeat
put DBCount() into maxRecord
put DBCloseSession() into DBResult
if dbID < 0 then
cursor -1
BadOpenDatabaseAlert
exit
end if
put 1 into topPointsToLine
doCreateScroll
put 1 into startChar
repeat with i = the number of chars of browseDBFile down to 1
if the machineType <> 256 then
-- for mac
if char i of browseDBFile = ":" then
put i into startChar
exit repeat
end if
else
-- for mac
if char i of browseDBFile = "\" then
put i into startChar
exit repeat
end if
end if
end repeat
if i = 1 then
put browseDBFile into shortFileName
else
put char (startChar+1) to (the number of chars of browseDBFile) of browseDBFile¼
into shortFileName
end if
put string(browseDBRecord) & " of " & string(maxRecord) into field "browseMessage"
set the foreColor of member "browseMessage" to dgDkBlueColor
set the textSize of member "browseMessage" to 9
set the textStyle of member "browseMessage" to "bold"
set the textFont of member "browseMessage" to "Helvetica"
if browseDBRecord = 1 then
set the castNum of sprite 14 to (the number of cast "prevDisabled")
else
set the castNum of sprite 14 to (the number of cast "prevEnabled")
end if
if browseDBRecord = maxRecord then
set the castNum of sprite 13 to (the number of cast "nextDisabled")
else
set the castNum of sprite 13 to (the number of cast "nextEnabled")
end if
updateStage
cursor -1
end doRecordScroll